<%
   request.headers['REQUEST_URI'] = "" if request.headers['REQUEST_URI'].nil?
   realUrl = request.original_url
   if   (realUrl.match(/forge\.trustie\.net\/*/))
     @nav_dispaly_project_label = 1
     @nav_dispaly_forum_label = 1
   elsif (realUrl.match(/course\.trustie\.net\/*/))
     @nav_dispaly_course_all_label = 1
     @nav_dispaly_forum_label = 1
     @nav_dispaly_course_label = nil
     @nav_dispaly_store_all_label = 1
   elsif (realUrl.match(/user\.trustie\.net\/*/))
     @nav_dispaly_home_path_label = 1
     @nav_dispaly_main_course_label = 1
     @nav_dispaly_main_project_label = 1
     @nav_dispaly_main_contest_label = 1
   elsif (realUrl.match(/contest\.trustie\.net\/*/))
     @nav_dispaly_contest_label = 1
     @nav_dispaly_store_all_label = 1
   elsif (realUrl.match(/ossean\.trustie\.net\/*/))
     @nav_dispaly_osp_index_label = 1
     @nav_dispaly_project_label = nil
     @nav_dispaly_project_all_label = nil
     @nav_dispaly_course_all_label = nil
     @nav_dispaly_forum_label = nil
     @nav_dispaly_bid_label = nil
     @nav_dispaly_contest_label = nil
     @nav_dispaly_store_all_label = nil
     @nav_dispaly_user_label = nil
   elsif (realUrl.match(/localhost:3000\/*/))
     @nav_dispaly_osp_index_label = 1
     @nav_dispaly_project_label = nil
     @nav_dispaly_project_all_label = nil
     @nav_dispaly_course_all_label = nil
     @nav_dispaly_forum_label = nil
     @nav_dispaly_bid_label = nil
     @nav_dispaly_contest_label = nil
     @nav_dispaly_store_all_label = nil
     @nav_dispaly_user_label = nil
   else
   	 @nav_dispaly_osp_index_label = 1
     # @nav_dispaly_project_all_label = 1
     # @nav_dispaly_course_all_label = 1
     # @nav_dispaly_forum_label = 1
     # @nav_dispaly_bid_label = 1
     # @nav_dispaly_contest_label = 1
     # @nav_dispaly_store_all_label = 1
     # @nav_dispaly_user_label = 1
   end
%>
<div id="top-menu" style="background-color: #269AC9;height:40px;margin-top: 10px;margin-bottom: 10px;">
  <div class="welcome_logo">
    <%= link_to image_tag("/images/logo.png", weight: "36px", height: "36px"), home_path %>
  </div>
  <%# 自建导航条在base页面中以 (@nav_dispaly......) 开头变量设定， 全局搜索即可发现 %>
</div>
<div style="border-top:solid 1px #C6E9F1;width:940px;margin-left:auto;margin-right:auto;margin-bottom: 0px;margin-top: -10px;"></div>
<div style="clear:left;"></div>

<script type="text/javascript">
    function addSlipMenu() {
        var loggedas = $('#loggedas ul li:first')
        var sub_menu = $('.sub_menu')
        loggedas.mouseenter(function (event) {
            sub_menu.show();
        });
        sub_menu.mouseleave(function (event) {
            sub_menu.hide();
        });
    }

    $(document).ready(function () {
        addSlipMenu();
    });

    jQuery(document).ready(function ($) {
        $('.sub_menu').find("a").attr('target', '_blank');
    });
</script>

<!-- ajax user trace zhangxunhui begin -->
<script type="text/javascript">
	function user_trace_click_project_list(session_id){
    	$.ajax({
			contentType: "application/json; charset=utf-8",
			timeout: 5000,
			url: '/user_traces/click_project_list?session_id=' + session_id,
			dataType: "json"
		});
    }
</script>
<!-- ajax user trace zhangxunhui end -->